﻿using Manon.Core.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Manon.Gateway.ApplicationCore.Dtos.Routes
{
    public class GetAllRoutesOutput
    {
        public int Id { get; set; }

        public int ProjectId { get; set; }
        public string DownstreamPathTemplate { get; set; }
        public string UpstreamPathTemplate { get; set; }
        public string UpstreamHttpMethod { get; set; }
        public List<string> UpstreamHttpMethodList
        {
            get
            {
                return MConvert.ToList<String>(UpstreamHttpMethod);
            }
            set { }
        }

        public string DownstreamHttpMethod { get; set; }

        public string RequestIdKey { get; set; }
        public int Cache_TtlSeconds { get; set; }
        public string Cache_Region { get; set; }
        public bool RouteIsCaseSensitive { get; set; }
        public string ServiceName { get; set; }
        public string ServiceNamespace { get; set; }
        public string DownstreamScheme { get; set; }
        public int Qos_ExceptionsAllowedBeforeBreaking { get; set; }
        public int Qos_DurationOfBreak { get; set; }
        public int Qos_TimeoutValue { get; set; }



        public string LoadBalancer_Type { get; set; }

        public string LoadBalancer_Key { get; set; }

        public int LoadBalancer_Expiry { get; set; }

        public bool RateLimit_EnableRateLimiting { get; set; }
        public string RateLimit_Period { get; set; }

        public decimal RateLimit_PeriodTimespan { get; set; }

        public decimal RateLimit_Limit { get; set; }

        public string RateLimit_WhiteList { get; set; }

        public List<string> RateLimit_WhiteList_list
        {
            get
            {
                return MConvert.ToList<string>(this.RateLimit_WhiteList);
            }
            set { }
        }
        public string Authentication_AuthenticationProviderKey { get; set; }

        public string Authentication_AllowedScopes { get; set; }

        public List<string> Authentication_AllowedScopes_List
        {
            get
            {
                return MConvert.ToList<string>(this.Authentication_AllowedScopes);
            }
            set { }
        }
        public bool HttpHandler_AllowAutoRedirect { get; set; }
        public bool HttpHandler_UseCookieContainer { get; set; }
        public bool HttpHandler_UseTracing { get; set; }
        public bool HttpHandler_UseProxy { get; set; }

        public int HttpHandler_MaxConnectionsPerServer { get; set; }

        public string UpstreamHost { get; set; }
        public string Key { get; set; }
        public string DelegatingHandlers { get; set; }
        public int Priority { get; set; } = 1;
        public int Timeout { get; set; }
        public bool DangerousAcceptAnyServerCertificateValidator { get; set; }
        public string Security_IPAllowedList { get; set; }

        public string Security_IPBlockedList { get; set; }

        public List<string> Security_IPAllowedList_List
        {
            get
            {
                return MConvert.ToList<string>(this.Security_IPAllowedList);
            }
            set { }
        }
        public List<string> Security_IPBlockedList_List
        {
            get
            {
                return MConvert.ToList<string>(this.Security_IPBlockedList);
            }
            set { }
        }
        public string DownstreamHttpVersion { get; set; }



        public Dictionary<string,string> Headers { get; set; }

        public Dictionary<string, string> HeaderUpTransforms { get; set; }

        public Dictionary<string, string> HeaderDownTransform { get; set; }

        public Dictionary<string, string> Claims { get; set; }

        public Dictionary<string, string> RouteClaims { get; set; }

        public Dictionary<string, string> Queries { get; set; }

        public Dictionary<string, string> DownTempletes { get; set; }

        public List<GetHostPortOutput> HostPort { get; set; }
    }
}
